RHQ provides several options for remote clients:
CLI (command line interface)
Java Client
The CLI is a powerful scripting tool for interacting with the RHQ Server. It offers Rhino JavaScript as the scripting environment. Rhino is a Java-backed implementation of JavaScript. Communication with the RHQ Server is through JBoss Remoting.
This is the recommended approach if you're looking for a remote script-based client. For more on running the CLI see Running the RHQ CLI.
When a scripting solution is not viable a programmatic client can be written. The easiest to write is a Java client as it can leverage the Remote API via JBoss Remoting, in the same fashion as the CLI
This is the recommended approach for a programmatic remote client, if Java is an option. For more see Building a Remote Java Client.
A REST API was added to RHQ in version 4.3. It is still considered beta, so the API may change. See the REST design page.